package filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class AFilter implements Filter {
    @Override
    public void init(FilterConfig config) throws ServletException {
        System.out.println("过滤器A创建");
    }


    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain)
            throws IOException, ServletException {
        System.out.println("A执行过滤");
        chain.doFilter(servletRequest, servletResponse);
        System.out.println("A过滤完成");
    }

    @Override
    public void destroy() {
        System.out.println("A过滤器销毁");
    }

}





